﻿using Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dal
{
    public class ZhangHuDal
    {
        public ZhangHuDal(BabyfaceEntities _db)
        {
            db = _db;
        }
        public BabyfaceEntities db { get; set; }

        public int Add(ZhangHu entity)
        {
            var Company = entity.Company;
            var TUser = entity.TUser;

            db.Company.Add(Company);

            TUser.CompanyId = Company.CompanyId;
            db.TUser.Add(TUser);

            db.SaveChanges();
            return Company.CompanyId;
        }

    }
}
